<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<script type="text/javascript">
	
	function openAdmin(){
		window.open('/ecom/admin/adminmember','newwindow','width = 700, height = 700, toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, location=no');		
	}

</script>

<body>
<div class="header-middle"><!--header-middle-->
			<div class="container">
				<div class="row">
					<div class="col-sm-4">
						<div class="logo pull-left">
							<a href="/ecom"><img src="${pageContext.request.contextPath}/resources/images/home/logo.png" alt="" /></a>
						</div>
					</div>
					
					<%
			    		String sid = (String)session.getAttribute("sid");
			    		boolean admin = Boolean.valueOf(String.valueOf(session.getAttribute("admin")));
						request.setAttribute("sid", sid);
						request.setAttribute("admin", admin);
					%>

			
					<!-- 로그인 안했을 때 -->
					
					<c:if test="${requestScope.sid==null}">
						<div class="col-sm-8">
						<div class="shop-menu pull-right">
							<ul class="nav navbar-nav">
								<li><a href="${pageContext.request.contextPath}/member/joinform"><i class="fa fa-user"></i> 회원가입</a></li>
								<li><a href="${pageContext.request.contextPath}/member/loginform"><i class="fa fa-lock"></i> 로그인</a></li>
								<li><a href="${pageContext.request.contextPath}/cart/cartform"><i class="fa fa-shopping-cart"></i> 장바구니</a></li>
							</ul>
						</div>
					</div>					
					</c:if>


					<!-- 로그인 했을 때 -->
					<c:if test="${requestScope.sid!=null}">
						<div class="col-sm-8">
							<div class="shop-menu pull-right">
								<ul class="nav navbar-nav">
									<c:if test="${requestScope.admin}">
										<li><a href="javascript:openAdmin()"><i class="fa fa-crosshairs"></i><font color="red"><strong>관리자페이지</strong></font></a></li>
									</c:if>
									<li><a href="${pageContext.request.contextPath}/member/modifyform"><i class="fa fa-crosshairs"></i> 회원정보수정</a></li>
									<li><a href="${pageContext.request.contextPath}/member/loginaction?logout=1"><i class="fa fa-crosshairs"></i> 로그아웃</a></li>
									<li><a href="${pageContext.request.contextPath}/cart/cartform"><i class="fa fa-shopping-cart"></i> 장바구니</a></li>
								</ul>
							</div>
						</div>
					</c:if>
				</div>
			</div>
		</div>

